package com.bookstore.app;

import java.math.BigDecimal;
import java.util.Date;

import org.hibernate.Session;
import org.hibernate.Transaction;

import com.bookstore.model.entity.Book;
import com.bookstore.model.util.HibernateUtil;

public class Main {
	
	public static void main(String[] args) {
		
		Session session = HibernateUtil.getSession();
		if(session.isConnected()){
			System.out.println("Connected");
		} 		
		
		Transaction tx = session.beginTransaction();
		Book book = new Book();
		book.setIsbn("isbn");
		book.setName("book");
		book.setPrice(new BigDecimal(10.00));
		book.setPublishDate(new Date());
	
		tx.commit();
		session.close();
		
		System.out.println("teste");
		System.out.println("teste2");
		System.out.println("note 1");
		System.out.println("pc 1");
		System.out.println("note 2");
	}

}
